<template>
  <el-button title="删除" @click.stop="deleteClick" class="widget-action-delete" circle plain size="default" type="danger">
    <el-icon><Delete /></el-icon>
  </el-button>
  <el-button title="清空" v-if="clear" @click.stop="clearClick" class="widget-action-clear" circle plain size="default" type="warning">
    <el-icon><Brush /></el-icon>
  </el-button>
  <el-button title="复制" @click.stop="cloneClick" class="widget-action-clone" circle plain size="default" type="primary">
    <el-icon><DocumentCopy /></el-icon>
  </el-button>
</template>

<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
  name: 'WidgetFormOperation',
  props: {
    clear: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    cloneClick() {
      this.$emit('clone');
    },
    deleteClick() {
      this.$emit('delete');
    },
    clearClick() {
      this.$emit('clear');
    }
  }
});
</script>
